$(document).ready(function() {
	var urlip = jurisdictionport + "/AuthorityController/login";
	$("#loginBtn").click(function() {
		var userName = $("#phone").val();
		var passWord = $("#password").val();
		$.ajax({
			//						async: false,
			//						cache: false,
			//						processData: false，
			type: 'get',
			url: urlip,
			data: {
				username: userName,
				password: passWord
			},
			dataType: "html",
			success: function(result) {
				var result = JSON.parse(result); //字符串转对象
				var code = result.code;
				if(code == '0') {
					/**重点：前台接收到返回值，直接处理就行*/
					//cookie存值
					var name = 'worktid';
					var value = {};
					value.worktid = result.object;
					value.name = userName;
					$.cookie(name, JSON.stringify(value), { expires: 7, path: '/' });
					location.href = "../webindex/index.html";
				} else {
					alert("账户不存在，请重新登录！")
				}
			},
			error: function() {
				alert('账户异常，请重新登录！'); /* 如果失败，可能是服务端 没有设置跨域*/
			}
		});
	});
});